<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 可被3整除的最大和 -->
    <script>
      var arr = [2, 5, 8, 64, 8, 1]
      var max = 0
      arr.sort((a, b) => a - b)
      const n = arr.length
      let sum = arr[n - 1] + arr[n - 2] + arr[n - 3]
      if (sum % 3 == 0) {
        sum
      }
      console.log(arr)
    </script>
  </body>
</html>
